<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->systemName;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：<span id="focus">菜单列表</span></div>
			<div id="topOtherMenu">
				<input type="button" name="insert" id="insert" value="添加顶级菜单" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'insert'));?>';" />
			</div>
		</div>
		<div id="body">
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
							<td width="5%" class="checkBoxTd">选择</td>
							<td width="8%">ID</td>
							<td>名称</td>
							<td>访问地址</td>
							<td>显示状态</td>
							<td>可用状态</td>
							<td>类型</td>
                            <td>说明文档</td>
							<td>排序号</td>
							<td width="10%" class="checkBoxTd">操作</td>
						</tr>
<?php
echo $this->listContent;
?>
					</table>
					<table class="controlTable">
						<tr>
							<td align="left">
								<input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
								<input type="submit" name="deleteBtn" id="deleteBtn" value="删除选中" class="button" onclick="return del();"/>
								<input type="submit" name="sortBtn" id="sortBtn" value="修改排序" class="button" onclick="$('#listForm').attr('action', '<?php echo $this->projectUrl(array('action'=>'sort'));?>');"/></td>
							<td align="right"></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除吗？')) {
		$("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete'));?>');
		$("#listForm").submit();
		return true;
	} else {
		return false;
	}
}
</script>
<script language="javascript">
$(".selectCheckBox").click(function(){
	var id = $(this).attr('dbid');
	var checked = this.checked;
	$(".selectCheckBox").each(function(i){
		var parentIds = $(this).attr('parentIds').split(',');
		for(i = 0; i <= parentIds.length - 1; i++) {
			if (parentIds[i] == id) {
				this.checked = checked;
				break;	
			}
		}
	});
});
</script>
</body>
</html>